package com.moyq5.permit.center.web.utils;

/**
 * @author Moyq5
 * @date 2018年8月14日
 */
public abstract class StringUtils {

	private final static char[] chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
	
	public static String random(int length) {
		final int bound = chars.length - 1;
		String str = "";
		for (int i = 0; i < length; i++) {
			int r = new Double(Math.random() * bound).intValue();
			str += chars[r];
		}
		return str;
	}
	
	public static boolean isEmpty(Object str) {
		return (str == null || "".equals(str));
	}
}
